//
//  XMGRecommendTagCell.m
//  百思不得姐
//
//  Created by 杨庆 on 2017/1/4.
//  Copyright © 2017年 杨庆. All rights reserved.
//

#import "XMGRecommendTagCell.h"
#import "XMGRecommendTag.h"
#import <SDWebImage/UIImageView+WebCache.h>//加载网络图片
@interface XMGRecommendTagCell()
@property (weak, nonatomic) IBOutlet UIImageView *imageListImageView;
@property (weak, nonatomic) IBOutlet UILabel *themeNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *subNumberLabel;

@end
@implementation XMGRecommendTagCell
//设置模型数据
-(void)setRecomdTag:(XMGRecommendTag *)recomdTag{
	_recomdTag=recomdTag;

	//加载网络图片 SDWebImage
	[self.imageListImageView sd_setImageWithURL:[NSURL URLWithString:recomdTag.image_list] placeholderImage:[UIImage imageNamed:@"defaultImageIcon"]];
	
	self.themeNameLabel.text=recomdTag.theme_name;
	
	NSString*subNumb=nil;
	if (recomdTag.sub_number < 10000) {
		subNumb=[NSString stringWithFormat:@"%zd人订阅",recomdTag.sub_number];

	}else{
		subNumb=[NSString stringWithFormat:@"%.1f万人订阅",recomdTag.sub_number/10000.0];

	}
	self.subNumberLabel.text=subNumb;
	}



-(void)setFrame:(CGRect)frame{
	frame.origin.x=10;
	frame.size.width -=2*frame.origin.x;
	frame.size.height -=1;
	[super setFrame:frame];
	
	
}

@end
